import React, { PropTypes } from 'react';
import { Table, Popconfirm, Pagination } from 'antd';
function CourseList({
    total,
    current,
    loading,
    dataSource,
    onPageChange,
  }){
    const columns = [{
        title:'花费时间',
        dataIndex:'costTime'
    },{
        title:'花费金额',
        dataIndex:'cost'
    },{
        title:'状态',
        dataIndex:'status'
    },{
        title:'操作',
        dataIndex:'operation',
        render(text,index,record){
            return (
              <p>
                <a>编辑</a>
                <Popconfirm title="确定要删除吗？">
                    <a>删除</a>
                </Popconfirm>
              </p>
            )
        }
    }];
    const pagination = {
      total,
      current,
      pageSize:10,
      onChange:onPageChange
    };
    return (
      <Table
        columns={columns}
        dataSource={dataSource}
        loading={loading}
        rowKey={record => record.id}
        pagination={pagination}
      />
    )
}

export default CourseList;
